<!-- 质检记录 -->
<template>
  <div class="qualityInspectionRecords">
    <div class="qualityInspectionRecords-header">
      <div class="qualityInspectionRecords-header-btn">
        <!-- <el-button size="mini">导出</el-button> -->
      </div>
      <div class="qualityInspectionRecords-header-info">
        <div class="qualityInspectionRecords-header-info-item">
          <span>库存可用数：</span>
          <span>{{data.quantityCurrTotal}}</span>
        </div>
        <div class="qualityInspectionRecords-header-info-item">
          <span>预计使用总量：</span>
          <span>{{data.quantityPredictTotal}}</span>
        </div>
        <div class="qualityInspectionRecords-header-info-item">
          <span>实际使用总量：</span>
          <span>{{data.quantityActualTotal}}</span>
        </div>
      </div>
    </div>
    <div class="qualityInspectionRecords-main">
      <el-table :data="data.mdProductBomVOList" border style="width: 100%" >
        <el-table-column type="index" label="序号" width="50"/>
        <el-table-column prop="bomItemCode" label="物料编号" ></el-table-column>
        <el-table-column prop="bomItemName" label="物料名称" ></el-table-column>
        <el-table-column prop="bomItemSpec" label="规格型号" ></el-table-column>
        <el-table-column prop="unitOfMeasure" label="单位" ></el-table-column>
        <el-table-column prop="itemTypeName" label="物料类型" ></el-table-column>
        <el-table-column prop="quantityPredict" label="预计使用量" ></el-table-column>
        <el-table-column prop="quantityActual" label="实际使用量" ></el-table-column>
        <el-table-column prop="quantityCurr" label="库存可用数" ></el-table-column>
        <el-table-column align="center" label="操作" >
          <template slot-scope="scope">
            <el-button type="text" size="mini" @click="handleToPlan">转采购计划</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'qualityInspectionRecords',
    props: {
      data: {
        type: Array,
        default: () => []
      }
    },
    data() {
      return {
        tableData: []
      }
    },
    created() {
      console.log('qualityInspectionRecords');
    },
    methods: {
      handleToPlan(){
        this.$router.push('/mes/purchase/purchaseOrder')
      }
    }
  }
</script>

<style lang="scss" scoped>
.qualityInspectionRecords {
  &-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
    // padding: 0 20px;
    &-btn {
      display: flex;
    }
    &-info {
      display: flex;
      justify-content: space-between;
      &-item {
        display: flex;
        align-items: center;
        margin-right: 20px;
        span {
          font-size: 12px;
        }
      }
    }
  }
}
</style>